logic definition and examples